from rest_framework.views import APIView

from rest_framework.response import Response
from .sers import *


class IndexView(APIView):

    def get(self, request):
        # 查询出所有的分类

        queryset = Category.objects.all()
        ser = CategorySer(queryset, many=True)
        return Response(ser.data)
